*------------- Upper-Body Strength and Political Egalitarianism: Twelve Conceptual Replications ------------------------------------*
*----------------------------------------------------- STUDY 8 ---------------------------------------------------------------------*

*** Creates handgrip strength variable as maximum value of the two dynamometer trials
egen handgrip=rowmax(håndgreb1 håndgreb2)

*** Factor analysis for self-reported strength and handgrip variable
factor s1q22 handgrip, pcf
* Predicts factor scores from factor analysis
predict strength

*Creates formidability measure on 0-1 scale reflecting min. and max. value for males and females, respectively
summ strength if s1q5 == 1
generate strength01 = (strength-(r(min)))/(r(max)-r(min)) if s1q5 == 1

summ strength if s1q5 == 2
replace strength01 = (strength-(r(min)))/(r(max)-r(min)) if s1q5 == 2


*Creates handgrip strength variable on 0-1 scale reflecting min. and max. value within sex
summ handgrip if s1q5 == 1
generate handgrip01 = (handgrip-(r(min)))/(r(max)-r(min)) if s1q5 == 1

summ handgrip if s1q5 == 2
replace handgrip01 = (handgrip-(r(min)))/(r(max)-r(min)) if s1q5 == 2


*** Economic conservatism variable
* Creates eonomic conservatism measure on 0-1 scale reflecting min. and max. value for males and females, respectively
alpha s2q1_1 s2q1_2 s2q1_3 s2q1_4 s2q1_5 s2q1_6, gen(EconCons) 
summ EconCons if s1q5 == 1
generate EconCons01 = (EconCons-(r(min)))/(r(max)-r(min)) if s1q5 == 1

summ EconCons if s1q5 == 2
replace EconCons01 = (EconCons-(r(min)))/(r(max)-r(min)) if s1q5 == 2


*--------------------------------------------------- ANALYSES --------------------------------------------*

*** Descriptive Statistics
* Sex (1 = male; 2 = female)
clonevar sex = s1q5
tab sex

* Age
clonevar age = s1q7
summ age

*Strength
bys sex: sum strength01
*Economic Conservatism
alpha s2q1_1 s2q1_2 s2q1_3 s2q1_4 s2q1_5 s2q1_6
bys sex: sum EconCons01


*** Tests if strength predicts economic conservatism
* Females
reg EconCons01 strength01 s1q7 if sex==2
* Males
reg EconCons01 strength01 s1q7 if sex==1



*** Tests if strength predicts economic conservatism when controlling for BIg Five personality (TIPI scale):

*** Creates personality variables on 0-1 scales reflecting min. and max. value for males and females, respectively
* Female subjects 
summ openness if sex == 2
generate open01 = (openness-(r(min)))/(r(max)-r(min)) if sex == 2

summ cont if sex == 2
generate cont01 = (cont-(r(min)))/(r(max)-r(min)) if sex == 2

summ extro if sex == 2
generate extro01 = (extro-(r(min)))/(r(max)-r(min)) if sex == 2

summ agree if sex == 2
generate agree01 = (agree-(r(min)))/(r(max)-r(min)) if sex == 2

summ neuro if sex == 2
generate neuro01 = (neuro-(r(min)))/(r(max)-r(min)) if sex == 2

* Male subjects 
summ openness if sex == 1
replace open01 = (openness-(r(min)))/(r(max)-r(min)) if sex == 1

summ cont if sex == 1
replace cont01 = (cont-(r(min)))/(r(max)-r(min)) if sex == 1

summ extro if sex == 1
replace extro01 = (extro-(r(min)))/(r(max)-r(min)) if sex == 1

summ agree if sex == 1
replace agree01 = (agree-(r(min)))/(r(max)-r(min)) if sex == 1

summ neuro if sex == 1
replace neuro01 = (neuro-(r(min)))/(r(max)-r(min)) if sex == 1

** Analyses controlling for Big 5 personality
* Female subjects
reg EconCons01 strength01 age open01 cont01 extro01 agree01 neuro01 if sex==2
* Male subjects
reg EconCons01 strength01 age open01 cont01 extro01 agree01 neuro01 if sex==1


** Analyses based on handgrip strength alone as formidability measure
* Female subjects
reg EconCons01 handgrip01 age if sex==2
* Male subjects
reg EconCons01 handgrip01 age if sex==1
